package fission;

/**
 *
 * @author MichaelAlbert
 */
public class FissionMove {
    
    private int row;
    private int column;
    private boolean type;
    
    public FissionMove(int row, int column, boolean type) {
        this.row = row;
        this.column = column;
        this.type = type;
    }
    
    public int getRow() {
        return row;
    }
    
    public int getColumn() {
        return column;
    }
    
    public boolean getType() {
        return type;
    }
    
    @Override
    public String toString() {
        return ((type) ? "V" : "H") + "[" + row + "," + column + "]";
    }

    @Override
    public int hashCode() {
        return (row << 20) + (column << 1) + ((type) ? 1 : 0);
    }
    
    @Override
    public boolean equals(Object o) {
        
        return  (o instanceof FissionMove) &&
                row == ((FissionMove) o).getRow() && 
                column == ((FissionMove) o).getColumn() && 
                type == ((FissionMove) o).getType();
    
    }

    int dRow() {
        return ((type) ? 1 : 0);
    }

    int dColumn() {
        return ((type) ? 0 : 1);
    }
    
    
    
}
